<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: absolute;
        }

        .box div {
            width: 300px;
            height: 300px;

        }

        .box div:last-child {
            /* 绝对定位 不占位置会脱标 */
            position: absolute;
            bottom: 0;
            right: 0;
        }
    </style>
</head>

<body>
    <h1>父级有定位就会相对于最近父级带有定位的作为参考</h1>
    <div class="box">
        <div style="background: blue;"></div>
        <div style="background: red;"></div>
    </div>
</body>

</html>